package com.lin.mq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @program: blog
 * @description: MQ常量
 * @author: Lin
 * @create: 2020-04-25 15:33
 **/
@Component
public class MQConstant {

    /**
     * MQ是否打开
     */
    public static Boolean MQ_IS_OPEN;


    /**
     * 添加文章主题
     */
    public static String TOPIC_ARTICLE_INSERT;

    /**
     * 删除文章主题
     */
    public static String TOPIC_ARTICLE_UPDATE;

    /**
     * 修改文章主题
     */
    public static String TOPIC_ARTICLE_REMOVE;


    @Value("${rocketmq.topic_article_insert}")
    public  void setTopicArticleInsert(String topicArticleInsert) {
        TOPIC_ARTICLE_INSERT = topicArticleInsert;
    }

    @Value("${rocketmq.topic_article_update}")
    public  void setTopicArticleUpdate(String topicArticleUpdate) {
        TOPIC_ARTICLE_UPDATE = topicArticleUpdate;
    }

    @Value("${rocketmq.topic_article_remove}")
    public  void setTopicArticleRemove(String topicArticleRemove) {
        TOPIC_ARTICLE_REMOVE = topicArticleRemove;
    }

    @Value("${rocketmq.mq_is_open}")
    public  void setMpIsOpen(Boolean mqIsOpen) {
        MQ_IS_OPEN = mqIsOpen;
    }
}
